/**
 * 
 */
package slhs.tempo.scriptGenerator;

import java.awt.LayoutManager;
import java.awt.event.ActionEvent;

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import org.mlc.swing.layout.LayoutConstraintsManager;

/**
 * CrossModalAndVideoProbeDataPanelParentHandler.java
 * 
 * @author Swapnil Devikar
 * 
 */
public class CrossModalAndVideoProbeDataPanelParentHandler extends JPanel implements PanelHandler {

    private static final String CROSS_MODAL_AND_VIDEO_PROBE_DATA_PANEL_LAYOUT = "CROSS_MODAL_AND_VIDEO_PROBE_DATA_PANEL_LAYOUT.xml";

    private JPanel crossModalAndVideoProbeDataPanelParentHandler;

    // here are declarations for the controls you created
    JLabel expectedAnswerLabel;
    JComboBox expectedAnswerComboBox;
    JLabel filePathLabel;
    JTextField filePathTextField;
    JLabel pauseBeforeProbeLabel;
    JTextField pauseBeforeProbeTextField;
    JButton browseButton;
    JComboBox categoriesComboBox;
    JTextField probeTextField;
    JLabel categoriesLabel;
    JLabel probeLabel;

    private AbstractButton probeDataPanel;

    public CrossModalAndVideoProbeDataPanelParentHandler() {
	super();
	initComponents();
	addComponents();
    }

    /**
     * 
     */
    private void initComponents() {
	// here are declarations for the controls you created
	crossModalAndVideoProbeDataPanelParentHandler = new JPanel();
	expectedAnswerLabel = new JLabel("Expected Answer");
	expectedAnswerComboBox = new JComboBox(UtilityConstants.EXPECTED_ANSWERS);
	filePathLabel = new JLabel("File Path");
	filePathTextField = new JTextField("Enter file path here");
	pauseBeforeProbeLabel = new JLabel("Time Before Probe (msec.)");
	pauseBeforeProbeTextField = new JTextField("Time in msec.");
	browseButton = new JButton("Browse");
	categoriesComboBox = new JComboBox(UtilityConstants.CATEGORIES);
	probeTextField = new JTextField("Probe");
	categoriesLabel = new JLabel("Categories");
	probeLabel = new JLabel("Probe");

    }

    /**
     * 
     */
    private void addComponents() {
	LayoutConstraintsManager layoutConstraintsManager = LayoutConstraintsManager.getLayoutConstraintsManager(this
		.getClass().getResourceAsStream(CROSS_MODAL_AND_VIDEO_PROBE_DATA_PANEL_LAYOUT));
	LayoutManager panelLayout = layoutConstraintsManager.createLayout("panel", this);
	crossModalAndVideoProbeDataPanelParentHandler.setLayout(panelLayout);
	crossModalAndVideoProbeDataPanelParentHandler.add(expectedAnswerLabel, "expectedAnswerLabel");
	crossModalAndVideoProbeDataPanelParentHandler.add(expectedAnswerComboBox, "expectedAnswerComboBox");
	crossModalAndVideoProbeDataPanelParentHandler.add(filePathLabel, "filePathLabel");
	crossModalAndVideoProbeDataPanelParentHandler.add(categoriesComboBox, "categoriesComboBox");
	crossModalAndVideoProbeDataPanelParentHandler.add(pauseBeforeProbeTextField, "pauseBeforeProbeTextField");
	crossModalAndVideoProbeDataPanelParentHandler.add(filePathTextField, "filePathTextField");
	crossModalAndVideoProbeDataPanelParentHandler.add(pauseBeforeProbeLabel, "pauseBeforeProbeLabel");
	crossModalAndVideoProbeDataPanelParentHandler.add(browseButton, "browseButton");
	crossModalAndVideoProbeDataPanelParentHandler.add(probeTextField, "probeTextField");
	crossModalAndVideoProbeDataPanelParentHandler.add(categoriesLabel, "categoriesLabel");
	crossModalAndVideoProbeDataPanelParentHandler.add(probeLabel, "probeLabel");

	// configure components
	categoriesComboBox.setEditable(true);
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    @Override
    public void actionPerformed(ActionEvent arg0) {
	// TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     * 
     * @see slhs.tempo.scriptGenerator.PanelHandler#getPanel()
     */
    @Override
    public JPanel getPanel() {
	// TODO Auto-generated method stub
	return crossModalAndVideoProbeDataPanelParentHandler;
    }

    /**
     * @param string
     */
    public void setPauseBeforeProbeLabel(String newText) {
	pauseBeforeProbeLabel.setText(newText);
    }

}
